<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateLeavingMessageTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('leaving_message', function (Blueprint $table) {
            $table->increments('id');
            $table->string('user_openid');
            $table->integer('prize_user_id');
            $table->string('name')->default('')->nullable();
            $table->string('tel')->default('')->nullable();
            $table->string('address')->default('')->nullable();
            $table->string('remarks')->default('')->nullable();
            $table->string('status')->default('0')->nullable();
            $table->unique(['user_openid','prize_user_id']);
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('leaving_message');
    }
}
